package unit2;

import java.util.Scanner;
public class Ex2_14_Login {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String password = "";
        int n = 0;
        do {
            n++;
            if (n > 3)
                break;
            System.out.println("请输入密码：");
            password = input.next();
        } while (!password.equals("adm123"));//内置密码：adm123
        if (n > 3) {
            System.out.println("密码三次输入错误，您无权登录系统！");
        } else {
            System.out.println("密码输入正确，登录成功！");
        }
    }
}
